package com.suray.wcs.service.system.bo;

import com.suray.wcs.service.system.entity.ZoneRuleDB;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author 12419
 * @title: ZoneRuleBO
 * @projectName web_dev
 * @description: TODO
 * @date 2021/1/2911:14
 */
@Data
public class ZoneRuleBO {

    private Integer ruleId;

    private Integer gridxStart;

    private Integer gridxEnd;

    private Integer gridyStart;

    private Integer gridyEnd;

    private List<Integer> gridzList;

    private String name;

    private Date createTime;

    private String createBy;

    private Date updateTime;

    private String updateBy;

    public ZoneRuleBO() {
    }

    public ZoneRuleBO(ZoneRuleDB zoneRuleDB) {
        this.ruleId = zoneRuleDB.getRuleId();
        this.name = zoneRuleDB.getName();
    }
    public static List<ZoneRuleBO> getZoneRuleBOListByDB(List<ZoneRuleDB> zoneRuleDBList){
        List<ZoneRuleBO> zoneRuleBOList = new ArrayList<>();
        for(ZoneRuleDB zoneRuleDB:zoneRuleDBList ){
            zoneRuleBOList.add(new ZoneRuleBO(zoneRuleDB));
        }
        return zoneRuleBOList;
    }
}
